<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="UTF-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1.0" />
	<meta http-equiv="X-UA-Compatible" content="ie=edge" />
	<title>flex换行</title>
	<style type="text/css">
		*{
			padding: 0px;
			margin: 0px;
		}
		div{
			display: flex;
			flex-wrap: wrap;		/*换行，并且保留盒子的尺寸*/
			height: 500px;
			border: 1px solid #000000;
		}
		.bigd div{
			width: 100px;
			height: 100px;
			background: pink;
		}
	</style>
</head>
<body>
	<div class="bigd">
		<div>1</div>
		<div>2</div>
		<div>3</div>
		<div>4</div>
		<div>5</div>
		<div>6</div>
		<div>7</div>
		<div>8</div>
	</div>
</body>
</html>